﻿Imports System.Runtime.InteropServices
Imports System.Threading

Public Class Form1
    Private _application As SolidEdgeFramework.Application
    Private WithEvents _applicationEvents As SolidEdgeFramework.DISEApplicationEvents_Event

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        _application = Marshal.GetActiveObject("SolidEdge.Application")
        _applicationEvents = _application.ApplicationEvents

        Dim f As ApartmentState
        f = Thread.CurrentThread.GetApartmentState()
    End Sub

    Private Sub _applicationEvents_AfterCommandRun(theCommandID As Integer) Handles _applicationEvents.AfterCommandRun
        'Dim objThread As Thread

        'lvEvents.Items.Add("AfterCommandRun")

        Dim f As ApartmentState
        f = Thread.CurrentThread.GetApartmentState()
    End Sub
End Class
